import matplotlib.pyplot as plt

# income = [11441.75728276138,1520.7427172386267,13662.5,11462.5,9525.0,3475.0,9412.5,9462.5]
# get1 = []
# get2 = []
#
# def computeIncome():
#     file = './program-data/5500-(0.3,0.1,0.3,0.3)-(0.3,0.04,0.36,0.3)-noBWH/income.txt'
#     pre_line=''
#     with open(file,'r') as f:
#         for line in f:
#             get1.append(line==pre_line)
#             if (len(get1) == 390):
#                 print(get1[389], line, pre_line)
#             pre_line=line
#
# def computeIncome2():
#     file = './program-data/5500-(0.3,0.1,0.3,0.3)-(0.3,0.04,0.36,0.3)-noBWH/income2.txt'
#     pre_line=''
#     with open(file,'r') as f:
#         for line in f:
#             get2.append(line==pre_line)
#             if (len(get2) == 390):
#                 print(get2[389], line, pre_line)
#             pre_line=line
#
#
# computeIncome()
# computeIncome2()
# for i,value in enumerate(get1):
#     if(get1[i]==get2[i]):
#         print(i,get1[i],get2[i])
# print(income)
# ratio = income
# sumnum=0
# for index,value in enumerate(income):
#     ratio[index] = value / 1520.7427172386267 *0.02
#     sumnum+=value
#
# print(ratio)
# print(sum(ratio))
#
# print(sumnum)
# print(5593*12.5)


# program-data\1w-(0.3,0.1,0.3,0.3)-(0.3,0.04,0.36,0.3)-(2,3)to(1)BWH-1

datalist = [[],[],[],[],[],[],[],[]]
file = './program-data/1w-(0.3,0.1,0.3,0.3)-(0.3,0.04,0.36,0.3)-(2,3)to(1)BWH-1/income.txt'
with open(file,'r') as f:
    for line in f:
        lists = line.rstrip().split(',')
        for index,value in enumerate(lists):
            value = float(value)
            datalist[index].append(value)
file = './program-data/1w-(0.3,0.1,0.3,0.3)-(0.3,0.04,0.36,0.3)-(2,3)to(1)BWH-1/income2.txt'
with open(file,'r') as f:
    for line in f:
        lists = line.rstrip().split(',')
        for index,value in enumerate(lists):
            value = float(value)
            datalist[index+4].append(value)

plt.plot([i for i in range(1,10001)],[datalist[1][i]+datalist[2][i] for i,v in enumerate(datalist[1])], [i for i in range(1,10001)], [12.5*i*0.2 for i in range(1,10001)])
plt.show()






